<template>
  <div class="spring_wrap">
    <div class="spring_header flex-between">
      <div class="title">
        <slot name="title">
          <div>
            <span>{{ title }}</span>
          </div>
          <div v-if="righticon">
            <img
              class="rightTitleIcon rightIcon"
              :src="righticon"
              alt=""
              srcset=""
            >
          </div>
        </slot>
      </div>
      <div class="header_right">
        <img
          src="@/assets/img/clear.png"
          alt=""
          @click="onclick"
        >
      </div>
    </div>
    <div class="spring_body">
      <div class="bodyCenter">
        <slot name="body" />
      </div>
    </div>
  </div>
</template>
<script>
export default {
    props: {
    // 图标
        icon: {
            type: String,
            default: ''
        },
        // 名称
        title: {
            type: String,
            default: ''
        }
    },
    methods: {
        onclick() {
            this.$store.dispatch('dlgShow', false)
        }
    }
}
</script>
<style lang="scss" scoped>
.header_right {
  width: 77px;
  height: 26px;
  img {
    width: 100%;
    height: 100%;
  }
}
.title {
  height: 36px;
  width: 100%;
  font-size: 18px;
  display: flex;
  align-items: center;
  text-align: left;
  color: #b4b4b4;
  letter-spacing: 4px;
  padding-left: 10px;
  box-sizing: border-box;
  justify-content: space-between;
  .titleIcon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    vertical-align: text-top;
  }
  .rightIcon,
  .centerIcon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    margin-left: 10px;
    vertical-align: text-top;
  }
  .rightTitleIcon {
    float: right;
    margin-right: 15px;
  }
}
.spring_body {
  width: 100%;
  height: calc(100% - 36px);
  padding: 0 20px 10px 10px;
  box-sizing: border-box;
  .bodyCenter {
    padding: 10px 30px;
    box-sizing: border-box;
    overflow: auto;
    width: 100%;
    height: 100%;
  }
}
.spring_wrap {
  width: 100%;
  height: 100%;
  padding-top: 10px;
  box-sizing: border-box;
}
</style>
